import Vue from 'vue'
import Router from 'vue-router'


// µÇÂ¼
const login = r => require.ensure([], () => r(require('@/page/login/login')), 'login')
// ×¢²á
const register = r => require.ensure([], () => r(require('@/page/login/register')), 'register')
// Íü¼ÇÃÜÂë
const password = r => require.ensure([], () => r(require('@/page/login/password')), 'password')
// Ñ¡ÔñÐÔ±ð
const choice = r => require.ensure([], () => r(require('@/page/login/choice')), 'choice')

// Ê×Ò³
const index = r => require.ensure([], () => r(require('@/page/home/index')), 'index')

// 节目列表
const mpList = r => require.ensure([], () => r(require('@/page/home/mpList')), 'mpList')

// 新闻列表
const newList = r => require.ensure([], () => r(require('@/page/home/newList')), 'newList')
// 新闻展示
const newShow = r => require.ensure([], () => r(require('@/page/home/newShow')), 'newShow')

// ËûµÄÏêÇéÒ³
const other = r => require.ensure([], () => r(require('@/page/other/other')), 'other')

// ÊÕµ½ÏûÏ¢ÁÐ±í
const news = r => require.ensure([], () => r(require('@/page/news/news')), 'news')

// ¹Ø×¢ÁÐ±í
const newsListA = r => require.ensure([], () => r(require('@/page/news/newsListA')), 'newsListA')

// ä¯ÀÀÁÐ±í
const newsListB = r => require.ensure([], () => r(require('@/page/news/newsListB')), 'newsListB')

// ÒÑ·¢ËÍÀñÎïÁÐ±í
const newsListC = r => require.ensure([], () => r(require('@/page/news/newsListC')), 'newsListC')

// ½»Ò×¼ÇÂ¼
const newsListD = r => require.ensure([], () => r(require('@/page/news/newsListD')), 'newsListD')


const news2 = r => require.ensure([], () => r(require('@/page/news/news2')), 'news2')

// ×¨Çø
const area = r => require.ensure([], () => r(require('@/page/area/area')), 'area')
// ×¨ÇøÁÐ±í
const arealist = r => require.ensure([], () => r(require('@/page/area/arealist')), 'arealist')
// 白富美
const arealistA = r => require.ensure([], () => r(require('@/page/area/arealistA')), 'arealistA')
// 有钱人
const arealistB = r => require.ensure([], () => r(require('@/page/area/arealistB')), 'arealistB')

// ·¢ÏÖ
const find = r => require.ensure([], () => r(require('@/page/find/find')), 'find')

// ¸öÈËÊ×Ò³
const aboutShow = r => require.ensure([], () => r(require('@/page/about/aboutShow')), 'aboutShow')
// ¸öÈËÐÅÏ¢
const about = r => require.ensure([], () => r(require('@/page/about/about')), 'about')
const logo = r => require.ensure([], () => r(require('@/page/about/logo')), 'logo')

// ±à¼­¸öÈËÐÅÏ¢
const aboutedit = r => require.ensure([], () => r(require('@/page/about/aboutedit')), 'aboutedit')
// ×î½üÀ´·Ã
const aboutlistA = r => require.ensure([], () => r(require('@/page/about/aboutlistA')), 'aboutlistA')

// webim
const webim1 = r => require.ensure([], () => r(require('@/page/webim/webim1')), 'webim1')
const webim2 = r => require.ensure([], () => r(require('@/page/webim/webim2')), 'webim2')

//ÑéÖ¤
const testA = r => require.ensure([], () => r(require('@/page/other/testA')), 'testA')
const testB = r => require.ensure([], () => r(require('@/page/other/testB')), 'testB')
const testC = r => require.ensure([], () => r(require('@/page/other/testC')), 'testC')
const testD = r => require.ensure([], () => r(require('@/page/other/testD')), 'testD')
const testE = r => require.ensure([], () => r(require('@/page/other/testE')), 'testE')


Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      component: login,
      meta:{index:2,footer:true,header:true,title:'登录'}
    },
    {
      path: '/login',
      component: login,
      meta: { keepAlive: true,index:2,footer:true,header:true,title:'登录' }
    },
    {
      path: '/webim1',
      component: webim1,
      meta:{index:3,footer:false,header:true}
    },
    {
      path: '/webim2',
      component: webim2,
      meta:{index:3,footer:false,header:true,title:'登录'}
    },
    {
      path: '/register',
      component: register,
      meta:{index:2,footer:false,header:false,title:'注册'}
    },
    {
      path: '/password',
      component: password,
      meta:{index:2,footer:false,header:false,title:'找回密码'}
    },
    {
      path: '/choice',
      component: choice,
      meta:{index:2,footer:true,header:true,title:'选择性别'}
    },
    {
      path: '/index',
      component: index,
      meta:{index:1,footer:true,header:true,title:'告别单身'}
    },
    {
      path: '/newShow',
      component: newShow,
      meta:{index:1,footer:false,header:true,title:'文章详情'}
    },
    {
      path: '/newList',
      component: newList,
      meta:{index:1,footer:true,header:true,title:'文章中心'}
    },
    {
      path: '/mpList',
      component: mpList,
      meta:{index:1,footer:true,header:true,title:'节目中心'}
    },
    {
      path: '/other',
      component: other,
      meta:{index:2}
    },
    {
      path: '/news',
      component: news,
      meta:{auth:true,index:2}
    },
    {
      path: '/newsListA',
      component: newsListA,
      meta:{index:3,footer:false}
    },
    {
      path: '/newsListB',
      component: newsListB,
      meta:{index:3,footer:false}
    },
    {
      path: '/newsListC',
      component: newsListC,
      meta:{index:3,footer:false}
    },
    {
      path: '/newsListD',
      component: newsListD,
      meta:{index:3,footer:false}
    },
    {
      path: '/news2',
      component: news2,
      meta:{index:3,header:true,footer:true}
    },
    {
      path: '/find',
      component: find,
      meta:{auth:true,index:2,footer:true}
    },
    {
      path: '/area',
      component: area,
      meta:{index:2}
    },
    {
      path: '/arealist',
      component: arealist,
      meta:{index:3,footer:false}
    },
    {
      path: '/arealistA',
      component: arealistA,
      meta:{index:3,header:true,footer:true}
    },
    {
      path: '/arealistB',
      component: arealistB,
      meta:{index:3,header:true,footer:true}
    },
    {
      path: '/aboutShow',
      component: aboutShow,
      meta:{index:2,header:true,footer:false}
    },
    {
      path: '/about',
      component: about,
      meta:{auth:true,index:2}
    },
    {
      path: '/logo',
      component: logo,
      meta:{index:3,header:true,footer:false}
    },
    {
      path: '/aboutedit',
      component: aboutedit,
      meta:{index:3,footer:false}
    },
    {
      path: '/aboutlistA',
      component: aboutlistA
    },
    {
      path: '/testA',
      component: testA,
      meta:{index:3,footer:false}
    },
    {
      path: '/testB',
      component: testB,
      meta:{index:3,footer:false}
    },
    {
      path: '/testC',
      component: testC,
      meta:{index:3,footer:false}
    },
    {
      path: '/testD',
      component: testD,
      meta:{index:3,footer:false}
    },
    {
      path: '/testE',
      component: testE,
      meta:{index:3,footer:false}
    }
  ]
})
